//TBCIIS7PB
//20/11/2009 1:01:02 PM

var varWelcome;function buttonRollover(thisImgSrc)
{return thisImgSrc.replace("_off.","_on.");}
function buttonRolloff(thisImgSrc)
{return thisImgSrc.replace("_on.","_off.");}
function UpdateIncludeNearby(selectedObj,checkBoxName)
{if(selectedObj.options[selectedObj.selectedIndex].value=="-1")
{document.forms[0][checkBoxName].disabled=true;document.forms[0][checkBoxName].checked=false;}
else
{document.forms[0][checkBoxName].removeAttribute('disabled');document.forms[0][checkBoxName].parentElement.removeAttribute('disabled');}}
function DestinationChanged(ddDestination,chSurraoundingAreas)
{d=document.getElementById(ddDestination);n=document.getElementById(chSurraoundingAreas);if(d!=null)
{var selDestination=d.options[d.selectedIndex].value;if(selDestination=="-1")
{n.disabled=true;n.checked=bPreviousIncludeChecked;}
else
{if(SearchSurroundingContains(parseInt(selDestination)))
{n.checked=true;n.removeAttribute('disabled');n.parentElement.removeAttribute('disabled');}
else
{n.checked=bPreviousIncludeChecked;n.removeAttribute('disabled');n.parentElement.removeAttribute('disabled');}}}}
function SurroundingAreasChange(ddDestination,chSurraoundingAreas)
{n=document.getElementById(chSurraoundingAreas);d=document.getElementById(ddDestination);var selDestination=d.options[d.selectedIndex].value;bPreviousIncludeChecked=n.checked;}
function UpdateDateControl(selectedObj,controlName)
{var currentControlName="";var link="";if(selectedObj.checked==true)
{for(var form_loop=0;form_loop<document.forms.length;form_loop++)
{for(var elems=0;elems<document.forms[form_loop].length;elems++)
{if(document.forms[form_loop].elements[elems].name!="")
{currentControlName=document.forms[form_loop].elements[elems].name;if(currentControlName.indexOf(controlName)==0)
{document.forms[form_loop][currentControlName].disabled=true;}}}}
for(var i=0;i<document.links.length;i++)
{link=document.links[i].href;if(link.indexOf(controlName)>=0)
{document.links[i].disabled=true;document.links[i].onclick=function(){return false;}
if(document.links[i].style)
document.links[i].style.cursor='default';}}}
else
{for(var form_loop=0;form_loop<document.forms.length;form_loop++)
{for(var elems=0;elems<document.forms[form_loop].length;elems++)
{if(document.forms[form_loop].elements[elems].name!="")
{currentControlName=document.forms[form_loop].elements[elems].name;if(currentControlName.indexOf(controlName)==0)
{document.forms[form_loop][currentControlName].disabled=false;}}}}
for(var i=0;i<document.links.length;i++)
{link=document.links[i].href;if(link.indexOf(controlName)>=0)
{document.links[i].disabled=false;document.links[i].onclick=null;if(document.links[i].style)
document.links[i].style.cursor=document.all?'hand':'pointer';}}}}
function Redirect(strRedirectURL)
{window.location.href=strRedirectURL;}
function doLoad(strRedirectURL)
{setTimeout("Redirect('"+strRedirectURL+"')",10*1000);}
function ProvinceChanged(ddProvinceName,ddCountryName)
{var ddProvince=document.getElementById(ddProvinceName);var selProvince=ddProvince.options[ddProvince.selectedIndex].value;var ddCountry=document.getElementById(ddCountryName);if(selProvince!=-1)
{var varCountryID=selProvince.split("|")[0];for(var i=0;i<ddCountry.options.length;i++)
{if(ddCountry.options[i].value==varCountryID)
{ddCountry.options.selectedIndex=i;break;}}}
else
ddCountry.options.selectedIndex=0;}
function CountryChanged(ddProvinceName,ddCountryName)
{var ddProvince=document.getElementById(ddProvinceName);var ddCountry=document.getElementById(ddCountryName);var selCountry=ddProvince.options[ddProvince.selectedIndex].value;if(selCountry!=1&&selCountry!=2)
{ddProvince.options.selectedIndex=0;}}
function launchPopup(whichWindow){if(whichWindow!=""){objWin=window.open(whichWindow,"popWindow","status=0,toolbar=0,location=0,menubar=1,directories=0,resizable=1,scrollbars=1,height=400,width=790");}}
function launchPopupWindow(url,status,toolbar,location,menubar,resizable,scrollbars,width,height,id)
{var windowOptions="status="+status;windowOptions+=",toolbar="+toolbar;windowOptions+=",location="+location;windowOptions+=",menubar="+menubar;windowOptions+=",resizable="+resizable;windowOptions+=",scrollbars="+scrollbars;windowOptions+=",width="+width;windowOptions+=",height="+height;objWin=window.open(url,null,windowOptions);}
function loadIFrame(iFrameURL,iFrameID)
{var objIFrame=document.createElement("iframe");objIFrame.id=iFrameID;objIFrame.src=iFrameURL
document.body.appendChild(objIFrame);document.getElementById(iFrameID).style.display='none';}
function removeElement(id)
{var el=document.getElementById(id);if(el!=null)
document.body.removeChild(el);return true;}
function HideJavaScriptDisabledMessage(formitem)
{if(document.getElementById)
{var style2=document.getElementById(formitem).style;style2.display="none";}
else if(document.all)
{var style2=document.all[formitem].style;style2.display="none";}
else if(document.layers)
{var style2=document.layers[formitem].style;style2.display="none";}}
function RadioButtonGroupDeselectAll(formname,radiobuttongroupname)
{if(formname!=null&&radiobuttongroupname!=null)
{var radioGroup=document.forms[formname].elements[radiobuttongroupname];if(!radioGroup)
return"";var radioLength=radioGroup.length;if(radioLength==undefined)
return"";if(radioGroup.checked)
{radioGroup.checked=false;return"";}
for(var i=0;i<radioLength;i++)
{radioGroup[i].checked=false;}
return"";}}
function ValidatePostalCode(ddCountry,txtPostalCode)
{var bIsvalid=true;var ddCountry=document.getElementById(ddCountry);var selCountry="";if(ddCountry!=null)
selCountry=ddCountry.options[ddCountry.selectedIndex].value;var varPostalCodeValue=document.getElementById(txtPostalCode).value;var trimmedPostalCode="";if(varPostalCodeValue!=null&&varPostalCodeValue.length>0)
trimmedPostalCode=varPostalCodeValue.replace(" ","");if(selCountry!=null&&(selCountry=="1"||selCountry=="2"))
{if(trimmedPostalCode!=null&&trimmedPostalCode.length>0)
{if((selCountry=="1"&&trimmedPostalCode.length<6)||(selCountry=="2"&&trimmedPostalCode.length<5))
bIsvalid=false;else
{var result;if(selCountry=="1")
{var objRegExp=/^\D{1}\d{1}\D{1}\-?\d{1}\D{1}\d{1}$/;result=objRegExp.test(trimmedPostalCode);}
if(selCountry=="2")
{var objRegExp=/(^\d{5}([\-]\d{4})?$)/;result=objRegExp.test(trimmedPostalCode);}
if(result!=null)
bIsvalid=true;else
bIsvalid=false;}}}
else
bIsvalid=true;return bIsvalid;}
function ShowHideComments(){var style;var style2;if(document.getElementById)
{style=document.getElementById('CommentPublishingContainer').style;style2=document.getElementById('BlogEntryContainer').style;}
else if(document.all)
{style=document.all['CommentPublishingContainer'].style;style2=document.all['BlogEntryContainer'].style;}
else if(document.layers)
{style=document.layers['CommentPublishingContainer'].style;style2=document.layers['BlogEntryContainer'].style;}
if(style.display=="none")
style.display="";else
style.display="none"
if(style2.display=="none")
style2.display="";else
style2.display="none";}
function SubmitMyForm(e,submitButtonName)
{var keynum;var keychar;var numcheck;var button=document.getElementById(submitButtonName);if(window.event)
{keynum=e.keyCode
if(keynum==13&&button!=null)
{button.click();}}
else if(e.which)
{keynum=e.which
if(keynum==13&&button!=null)
{button.click();}}}
function ValidateYesNoRadioControls(ControlNameYes,ControlNameNo)
{var varControlYes=document.getElementById(ControlNameYes);var varControlNo=document.getElementById(ControlNameNo);if(varControlYes!=null&&varControlNo&&(varControlYes.checked||varControlNo.checked))
return true;else
return false;}
function SayHello(ElementId,UserIDCookieName)
{varWelcome=document.getElementById(ElementId);var UserId=Get_Cookie(UserIDCookieName);if(varWelcome!=null)
{if(UserId!=null)
ManageTravelBase.SayHelloToUser(UserId,SayHelloToUser_CallBack);}}
function SayHelloToUser_CallBack(response)
{if(response.error!=null)
{varWelcome.innerHTML='Hello';}
else
{var oMsg=response.value;varWelcome.innerHTML=oMsg;}}
function Get_Cookie(name)
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
{return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));}
function _hbxStrip(a){a=a.split("|").join("");a=a.split("/").join("");a=a.split("!").join("");a=a.split("&").join("");a=a.split("'").join("");a=a.split("#").join("");a=a.split("$").join("");a=a.split("%").join("");a=a.split("^").join("");a=a.split("*").join("");a=a.split(":").join("");a=a.split("~").join("");a=a.split(" ").join("+");return a;}
function ShowHideElement(elementToShow,elementToHide)
{var style;var style2;if(document.getElementById)
{style=document.getElementById(elementToShow).style;style2=document.getElementById(elementToHide).style;}
else if(document.all)
{style=document.all[elementToShow].style;style2=document.all[elementToHide].style;}
else if(document.layers)
{style=document.layers[elementToShow].style;style2=document.layers[elementToHide].style;}
style.display="";style2.display="none";}
function HideManageUsersLink()
{var varHideUsers=document.getElementById('idMngUsersFlip');if(varHideUsers!=null)
varHideUsers.style.display="none";}
function SelectCountry(CookieName,ddName,QueryStringCountry)
{var CookieValue;d=document.getElementById(ddName);if(QueryStringCountry!=null&&QueryStringCountry!='')
{CookieValue=QueryStringCountry;}
else
{CookieValue=Get_Cookie(CookieName);if(CookieValue==null||CookieValue=='')
{CountrySelectorBase.GetUserCountryID(function(response){if(response.error==null)
{CookieValue=response.value;SetCookie('CountryCode',CookieValue,null,'/',window.location.hostname);}});}}
if(d!=null&&CookieValue!=null)
{for(var i=0;i<d.options.length;i++)
{if(d.options[i].value.indexOf("|"+CookieValue+"|")>-1)
{d.options.selectedIndex=i;break;}}}
if(QueryStringCountry!=null&&QueryStringCountry!='')
{if(d!=null)
{var vSelected=d.value;var CountryCode=vSelected.substring(vSelected.indexOf("|")+1);CountryCode=CountryCode.substring(0,2);SetCookie('CountryCode',CountryCode,null,'/',window.location.hostname);}}}
function showLightbox(){thisImageLink=document.getElementById("imageLink_"+idCurrentPhoto);Lightbox.start(thisImageLink);}
function writeCurrentPhotoPaging(){if(idCurrentPhoto!=""&&idTotalPhotos!=""){if(document.getElementById("LBPhotoPaging")){document.getElementById("LBPhotoPaging").innerHTML=idCurrentPhoto+" of "+idTotalPhotos;}}}
function nextLBPhoto(){if(idCurrentPhoto<idTotalPhotos){document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="none";idCurrentPhoto++;document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="block";writeCurrentPhotoPaging();}else{document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="none";idCurrentPhoto=1;document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="block";writeCurrentPhotoPaging();}}
function previousLBPhoto(){if(idCurrentPhoto>1){document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="none";idCurrentPhoto--;document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="block";writeCurrentPhotoPaging();}else{document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="none";idCurrentPhoto=idTotalPhotos;document.getElementById("lbContentItem_"+idCurrentPhoto).style.display="block";writeCurrentPhotoPaging();}}
var YellowIcon="images/icons/yellow_icon_dot.gif";var RedIcon="images/icons/red_icon.gif";var PurpleIcon="images/icons/purple_icon.gif";var BlueIcon="images/icons/turquoise_icon_dot.gif";var GreenIcon="images/icons/green_icon.gif";var OrangeIcon="images/icons/orange_icon_dot.gif";var VICIcon="images/icons/icon_vic_blank.gif";var EntityList=[];var bMapCreated=false;function callAjax(loc,feat,type,clientid)
{var key=loc+'_'+feat+'_'+type;if(!EntityList[key])
FeaturedEntitiesControlBase.GetFeaturedInformation(loc,feat,type,clientid,call_back);else
{fillContent(EntityList[key].Title,EntityList[key].Details,EntityList[key].More,EntityList[key].Children,clientid);}}
function call_back(response)
{var details=response.value
if(details!=null&&details.length>0)
{fillContent(details[1],details[2],details[3],details[5],details[6])
var newEntity=new FeaturedEntity(details[0]);newEntity.Title=details[1];newEntity.Details=details[2];newEntity.More=details[3];newEntity.Children=details[5];newEntity.ClientId=details[6];EntityList[newEntity.Key]=newEntity;}}
function fillContent(title,details,more,children,clientId)
{var element=getElement(clientId+'_litColumn1Title');element.innerHTML=title;element=getElement(clientId+'_litDetails');element.innerHTML=details;element=getElement(clientId+'_litMoreTag');element.innerHTML=more;element=getElement(clientId+'_litChildList');var childList='<ul>';if(!children)
children=[];if(children&&children!=null&&children!=undefined)
{for(var i=0;i<children.length;i++)
{childList=childList+children[i];}}
childList=childList+'</ul>';element.innerHTML=childList;}
function callVideoAjax(vidId,plId)
{var key=vidId+'_'+plId;if(!EntityList[key])
VideoPlayListControlBase.GetVideoInformation(vidId,plId,video_call_back);else
{fillVideoContent(EntityList[key].Title,EntityList[key].PlayListTitle,EntityList[key].Description,EntityList[key].EmbedHtml,EntityList[key].Width,EntityList[key].Height,EntityList[key].PlayerLink,EntityList[key].SeeMoreLink);}}
function video_call_back(response)
{var details=response.value
if(details!=null&&details.length>0)
{fillVideoContent(details[1],details[2],details[3],details[4],details[5],details[6],details[7],details[8])
var newEntity=new VideoEntity(details[0]);newEntity.Title=details[1];newEntity.PlayListTitle=details[2];newEntity.Description=details[3];newEntity.EmbedHtml=details[4];newEntity.Width=details[5];newEntity.Height=details[6];newEntity.PlayerLink=details[7];newEntity.SeeMoreLink=details[8];EntityList[newEntity.Key]=newEntity;}}
function fillVideoContent(title,playlisttitle,description,embedhtml,width,height,playerlink,seeMoreLink)
{var element=getElement('featureVideoItem');try{if(playerlink!=null&&playerlink.length>0)
{$("featureVideoItem").style.display="";$("featureImageItem").style.display="none";makeMovie(playerlink,width,height,'featureVideoItem',true);}
else
{$("featureImageItem").innerHTML=embedhtml;$("featureVideoItem").style.display="none";$("featureImageItem").style.display="";}
element=getElement('videoCategory');element.innerHTML=playlisttitle.replace("&","&amp;");element=getElement('featureVideoTitle');element.innerHTML=title;element=getElement('featureVideoTextContent');element.innerHTML=description;if(description.indexOf("featureVideoTextRemainingContent")>0)
$("featureVideoContainerVisibleToggle").style.display="";else
$("featureVideoContainerVisibleToggle").style.display="none";element=getElement('spSeeMoreLink');element.innerHTML=seeMoreLink;}catch(err){}}
function getElement(elName){var el=null;if(document.getElementById)
el=document.getElementById(elName);else if(document.all)
el=document.all[elName];return el;}
function FeaturedEntity(key)
{this.Key=key;this.Title="";this.Details="";this.More="";this.Map="";this.Children=new Array();this.ClientId="";}
function VideoEntity(key)
{this.Key=key;this.Title="";this.PlayListTitle="";this.Description="";this.EmbedHtml="";this.Width=0;this.Height=0;this.PlayerLink="";this.SeeMoreLink="";}
function SetMapCenter(lat,long,name,regionid,map,hosturl,targetURL,offsetx,offsety)
{map.checkResize();var icon=new GIcon(G_DEFAULT_ICON);icon.image=hosturl+YellowIcon;map.clearOverlays();if(lat!=0&&long!=0)
{var latlong=new GLatLng(lat,long);var marker=new GMarker(latlong,icon);map.setCenter(latlong,5);map.addOverlay(marker);GEvent.addListener(marker,"click",function()
{window.location=targetURL;});}
else
{var address=name+', BC, CA';var geocoder=new GClientGeocoder();geocoder.getLatLng(address,function(point)
{if(!point)
{var defaultCentre=new GLatLng(54.22671256,-125.7585085);map.setCenter(defaultCentre,4);}
else
{var marker=new GMarker(point,icon);map.addOverlay(marker);map.setCenter(point,5);GEvent.addListener(marker,"click",function()
{window.location=targetURL;});}})}
if(targetURL)
{var MapObject=map.getContainer();MapObject.onclick=new Function("window.location='"+targetURL+"';");}
if((offsetx&&offsetx>0)||(offsety&&offsety>0)){var currCenter=map.fromLatLngToContainerPixel(map.getCenter());currCenter.x=currCenter.x-offsetx;currCenter.y=currCenter.y-offsety;map.setCenter(map.fromContainerPixelToLatLng(currCenter));}
HighlightRegionFromEncoded(regionid,false,false,map);}
function HighlightRegionFromEncoded(regionid,centerandzoom,usemapdefaults,map)
{var source="";var shape=null;for(i=0;i<RegionInfoArray.length;i+=1)
{if(i!=BCRegionID)
{if(RegionInfoArray[i])
{RegionInfoArray[i].showRegion=false;if(RegionInfoArray[i].shape)
{map.removeOverlay(RegionInfoArray[i].shape);}}}}
if(RegionInfoArray[regionid].shape)
{RegionInfoArray[regionid].showRegion=true;}
else
{var mypolygon=new GPolygon.fromEncoded({polylines:[{points:RegionInfoArray[regionid].encodedString,levels:RegionInfoArray[regionid].levels,color:RegionInfoArray[regionid].colour,opacity:0.7,weight:1,numLevels:RegionInfoArray[regionid].numlevels,zoomFactor:RegionInfoArray[regionid].zoomFactor}],fill:true,color:RegionInfoArray[regionid].colour,opacity:RegionInfoArray[regionid].opacity,outline:false});map.addOverlay(mypolygon);RegionInfoArray[regionid].shape=mypolygon;RegionInfoArray[regionid].showRegion=true;}
DrawRegions(map);if(centerandzoom)
{if(usemapdefaults)
map.setCenter(defaultCentre,defaultZoomLevel);else
map.setCenter(RegionInfoArray[regionid].centrePoint,RegionInfoArray[regionid].defaultZoomLevel);}}
function DrawRegions(mapObject)
{for(i=0;i<RegionInfoArray.length;i+=1)
{if(RegionInfoArray[i])
{if(RegionInfoArray[i].showRegion==true)
{mapObject.addOverlay(RegionInfoArray[i].shape);}}}}
function getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)
endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));}
function GetCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg)
return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return null;}
function SetCookie(name,value){var argv=SetCookie.arguments;var argc=SetCookie.arguments.length;var expires=(argc>2)?argv[2]:null;var path=(argc>3)?argv[3]:null;var domain=(argc>4)?argv[4]:null;var secure=(argc>5)?argv[5]:false;document.cookie=name+"="+escape(value)+
((expires==null)?"":("; expires="+expires.toGMTString()))+
((path==null)?"":("; path="+path))+
((domain==null)?"":("; domain="+domain))+
((secure==true)?"; secure":"");}
function DeleteCookie(name){var exp=new Date();exp.setTime(exp.getTime()-1);var cval=GetCookie(name);alert(cval);document.cookie=name+"="+cval+"; expires="+exp.toGMTString();}
function makeMovie(vidLink,width,height,divTag,allowFullScreen)
{var so=new SWFObject(vidLink,"",width,height,"8","#000000");if(allowFullScreen)
so.addParam("allowFullScreen","true");else
so.addParam("wmode","opaque");so.addParam("allowscriptaccess","always");so.addParam("redirectUrl","http://www.adobe.com/go/getflashplayer");so.write(divTag);}
function ConfirmGeneratePDFListings(ConfirmationMessage,NavigateURL)
{if(confirm(ConfirmationMessage))location.href=NavigateURL;}//TBCIIS7PB
//20/11/2009 1:01:02 PM

var defaultCentre=new GLatLng(54.22671256,-125.7585085);var defaultZoomLevel=5;var defaultStreetViewZoomLevel=14;var defaultSingleLocationZoomLevel=11;var defaultNumLocToShowInView=10;var defaultLineWidth=1;var constProvinceOutlineLayerName='ProvinceOutline';var BoundingRegionId=3;var BCRegionID=3;var DetailLocationId=-1;var YellowIcon="images/icons/yellow_icon_dot.gif";var RedIcon="images/icons/red_icon.gif";var PurpleIcon="images/icons/purple_icon.gif";var BlueIcon="images/icons/turquoise_icon_dot.gif";var GreenIcon="images/icons/green_icon.gif";var OrangeIcon="images/icons/orange_icon_dot.gif";var VICIcon="images/icons/icon_vic_blank.gif";var InvisibleIcon="images/spacer.gif";var VICProducts=new Array();var _curMap;function CWGoogleMap(locations,centrepoint,startzoomlevel,hostURL,MapDivName,InTestingMode,mapName,panoDIVName,panoContainerDIVName)
{this.curMap=new GMap2(document.getElementById(MapDivName));this.geocoder=new GClientGeocoder();_curMap=this;this.currentMapBounds=new GLatLngBounds();if(mapName)
this.mapName=mapName;this.mapDivName=MapDivName;this.hostURL=hostURL;this.IsInTestingMode=InTestingMode;this.selectedCity=-1;this.pegMan=null;this.lastMarkerLocation=null;this.streetViewOverlay=null;this.svPano=null;this.svClient=null;this.lastZoomLevel=null;this.lastMapCenter=null;this.panoDIVName="streetviewContents";this.svPano=new GStreetviewPanorama(document.getElementById(this.panoDIVName));this.panoContainerDIVName="streetviewContainer";if(centrepoint!=null)
{if(startzoomlevel!=null)
{if(startzoomlevel>1)
{this.curMap.setCenter(centrepoint,startzoomlevel);}
else
{this.curMap.setCenter(defaultCentre,defaultZoomLevel);}}
else
this.curMap.setCenter(centrepoint,defaultZoomLevel);}
else
this.curMap.setCenter(defaultCentre,defaultZoomLevel);if(locations)
{locations.sort(sortByPriority);this.locationsToRenderArray=locations;this.locationsArray=locations;}
var VICsToRenderArray=new Array();this.VICsOnMap=new Array();this.bShowVICs=false;this.baseIcon=new GIcon();this.baseIcon.shadow="http://www.google.com/mapfiles/shadow50.png";this.baseIcon.iconSize=new GSize(19,32);this.baseIcon.shadowSize=new GSize(37,34);this.baseIcon.iconAnchor=new GPoint(9,34);this.baseIcon.infoWindowAnchor=new GPoint(9,2);this.baseIcon.infoShadowAnchor=new GPoint(18,25);this.baseIcon.imageMap=[9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0];this.VICbaseIcon=new GIcon();this.VICbaseIcon.shadow="http://www.google.com/mapfiles/shadow50.png";this.VICbaseIcon.iconSize=new GSize(19,33);this.VICbaseIcon.shadowSize=new GSize(37,34);this.VICbaseIcon.iconAnchor=new GPoint(19,34);this.VICbaseIcon.infoWindowAnchor=new GPoint(9,2);this.VICbaseIcon.infoShadowAnchor=new GPoint(18,25);this.VICbaseIcon.imageMap=[9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0];this.VICbaseIconSearchResults=new GIcon();this.VICbaseIconSearchResults.shadow="/TBCCW/images/icons/icon_vic_shadow.png";this.VICbaseIconSearchResults.iconSize=new GSize(19,41);this.VICbaseIconSearchResults.shadowSize=new GSize(40,45);this.VICbaseIconSearchResults.iconAnchor=new GPoint(9,34);this.VICbaseIconSearchResults.infoWindowAnchor=new GPoint(9,2);this.VICbaseIconSearchResults.infoShadowAnchor=new GPoint(18,25);this.VICbaseIconSearchResults.imageMap=[9,0,6,1,4,2,2,4,0,8,0,12,1,14,2,16,5,19,7,23,8,26,9,30,9,34,11,34,11,30,12,26,13,24,14,21,16,18,18,16,20,12,20,8,18,4,16,2,15,1,13,0];this.pegManIcon=new GIcon(G_DEFAULT_ICON);this.pegManIcon.image="http://maps.gstatic.com/mapfiles/cb/man_arrow-0.png";this.pegManIcon.transparent="http://maps.gstatic.com/mapfiles/cb/man-pick.png";this.pegManIcon.imageMap=[26,13,30,14,32,28,27,28,28,36,18,35,18,27,16,26,16,20,16,14,19,13,22,8];this.pegManIcon.iconSize=new GSize(49,52);this.pegManIcon.iconAnchor=new GPoint(25,35);this.pegManIcon.infoWindowAnchor=new GPoint(25,5);this.largeControl=new GLargeMapControl();this.smallControl=new GSmallMapControl();this.curMap.addControl(this.largeControl);this.curMap.enableDoubleClickZoom();this.curMap.addControl(new GMapTypeControl());this.curMap.addMapType(G_PHYSICAL_MAP);this.SelectTopNLocationsInView=_SelectTopNLocationsInView;this.AddShapeLayer=_AddShapeLayer;this.OutlineProvince=_OutlineProvinceFromEncoded;this.AttachRecalculateViewEvents=_AttachRecalculateViewEvents;this.HighlightRegionFromEncoded=_HighlightRegionFromEncoded;this.GetLocationsArrayIndexByLocationId=_GetLocationsArrayIndexByLocationId;this.PlaceMarkerOnMap=_PlaceMarkerOnMap;this.RecenterStreetViewMap=_RecenterStreetViewMap;this.RestoreMapView=_RestoreMapView;this.PlacePegmanOnMap=_PlacePegmanOnMap;this.ShowPano=_ShowPano;this.RenderProductSearchResultLocations=_RenderProductSearchResultLocationsGoogle;this.RenderProductLocations=_RenderProductLocations;this.AttachPinMoveEvent=_AttachPinMoveEvent;this.DetachPinMoveEvent=_DetachPinMoveEvent;GEvent.addListener(this.curMap,"infowindowclose",function()
{DetailLocationId=-1;});this.HandleVICAjaxCall=_HandleVICAjaxCall;this.RenderVICMarkers=_RenderVICMarkers;}
function _ShowPano(locLatLong)
{var This=this;if(this.svPano==null)
this.svPano=new GStreetviewPanorama(document.getElementById(this.panoDIVName));this.svPano.setLocationAndPOV(locLatLong);var divPanoContainer=document.getElementById(this.panoContainerDIVName);divPanoContainer.style.display="block";var divCWMapContainer=document.getElementById(this.mapDivName);divCWMapContainer.style.height="250px";this.lastZoomLevel=this.curMap.getZoom();this.lastMapCenter=this.curMap.getCenter();this.RecenterStreetViewMap(locLatLong,250,this.curMap.getSize().width,defaultStreetViewZoomLevel,this.largeControl,this.smallControl);this.PlacePegmanOnMap(locLatLong);GEvent.addListener(this.svPano,"initialized",function(newSVLocation){This.pegMan.setLatLng(newSVLocation.latlng);});GEvent.addListener(this.svPano,"yawchanged",function(newYaw){var GUY_NUM_ICONS=16;var GUY_ANGULAR_RES=360/GUY_NUM_ICONS;if(newYaw<0){newYaw+=360;}
var guyImageNum=Math.round(newYaw/GUY_ANGULAR_RES)%GUY_NUM_ICONS;This.pegManIcon.image="http://maps.google.com/intl/en_us/mapfiles/cb/man_arrow-"+guyImageNum+".png";This.pegMan.setImage(This.pegManIcon.image);});}
function _RecenterStreetViewMap(selectedLocation,height,width,zoomLevel,mapControlToRemove,mapControltoAdd)
{this.curMap.closeInfoWindow();this.curMap.removeControl(mapControlToRemove);this.curMap.addControl(mapControltoAdd);var svSize=new GSize(width,height);this.curMap.size=svSize;this.curMap.checkResize();this.curMap.setCenter(selectedLocation,zoomLevel);}
function _PlacePegmanOnMap(curLocation)
{var This=this;if(this.pegMan!=null)
this.curMap.removeOverlay(this.pegMan);this.pegMan=new GMarker(curLocation,{icon:this.pegManIcon,draggable:true,title:'Drag me around and Click'});this.curMap.addOverlay(this.pegMan);this.lastMarkerLocation=curLocation;GEvent.addListener(this.pegMan,"dragstart",function()
{if(This.streetViewOverlay==null)
{This.streetViewOverlay=new GStreetviewOverlay();This.curMap.addOverlay(This.streetViewOverlay);}});GEvent.addListener(this.pegMan,"dragend",function()
{This.curMap.removeOverlay(This.streetViewOverlay);This.streetViewOverlay=null;var latlng=this.getPoint();if(This.svClient==null)
svClient=new GStreetviewClient();try{svClient.getNearestPanorama(latlng,function(svLatLong)
{if(svLatLong.code!=200){This.PlacePegmanOnMap(This.lastMarkerLocation);}
else
{This.lastMarkerLocation=svLatLong.Location.latlng;if(This.svPano==null)
This.svPano=new GStreetviewPanorama(document.getElementById(This.panoDIVName));This.svPano.setLocationAndPOV(svLatLong.Location.latlng);}});}catch(error){}});}
function _RestoreMapView(height)
{if(this.pegMan!=null)
this.curMap.removeOverlay(this.pegMan);if(this.streetViewOverlay!=null)
{this.curMap.removeOverlay(this.streetViewOverlay);this.streetViewOverlay=null;}
if(this.svPano!=null)
{this.svPano.remove();this.svPano=null;}
var divPanoContainer=document.getElementById(this.panoContainerDIVName);divPanoContainer.style.display="none";var divCWMapElem=document.getElementById(this.mapDivName);divCWMapElem.style.height=height;this.RecenterStreetViewMap(this.lastMapCenter,height,this.curMap.getSize().width,this.lastZoomLevel,this.smallControl,this.largeControl);}
function _AttachPinMoveEvent()
{var This=this;This.inEditMode=true;var varDivMap=document.getElementById(this.mapDivName);var varIdDetach=document.getElementById('id'+this.mapName+'Default');var varIdAttach=document.getElementById('id'+this.mapName+'AttachPin');var HiddenValue=document.getElementById('ctrl'+This.mapName+'_hiddenGeoData');varIdDetach.src=this.hostURL+"images/icons/btn_map_hand_off.gif";varIdAttach.src=this.hostURL+"images/icons/btn_map_orange_on.gif";if(this.locationsToRenderArray.length>0)
{if(!this.locationsToRenderArray[0].shape.draggable())
{var icon=new GIcon(This.baseIcon);icon.image=This.hostURL+OrangeIcon;var marker=new GMarker(this.locationsToRenderArray[0].shape.getLatLng(),{draggable:true,icon:icon});this.curMap.clearOverlays();this.curMap.addOverlay(marker);this.locationsToRenderArray[0].shape=marker;GEvent.addListener(marker,"dragend",function()
{if(This.clickEvent)
GEvent.removeListener(This.clickEvent);varIdDetach.src=This.hostURL+"images/icons/btn_map_hand_on.gif";varIdAttach.src=This.hostURL+"images/icons/btn_map_orange_off.gif";var varDivMap=document.getElementById(This.mapDivName);varDivMap.childNodes[0].style.cursor="";SetExactRadioButton();this.disableDragging();This.inEditMode=false;if(HiddenValue)
{HiddenValue.value=this.getPoint();}});GEvent.addListener(marker,"mousedown",function()
{if(This.inEditMode)
this.enableDragging();});}}
this.clickEvent=GEvent.addListener(this.curMap,"click",function(overlay,point)
{if(point)
{var icon=new GIcon(This.baseIcon);icon.image=This.hostURL+OrangeIcon;var marker=new GMarker(point,{draggable:true,icon:icon});This.curMap.clearOverlays();This.curMap.addOverlay(marker);This.inEditMode=false;marker.disableDragging();GEvent.addListener(marker,"dragend",function()
{if(This.clickEvent)
GEvent.removeListener(This.clickEvent);varIdDetach.src=This.hostURL+"images/icons/btn_map_hand_on.gif";varIdAttach.src=This.hostURL+"images/icons/btn_map_orange_off.gif";var varDivMap=document.getElementById(This.mapDivName);varDivMap.childNodes[0].style.cursor="";SetExactRadioButton();this.disableDragging();This.inEditMode=false;if(HiddenValue)
{HiddenValue.value=this.getPoint();}});GEvent.addListener(marker,"mousedown",function()
{if(This.inEditMode)
this.enableDragging();});if(HiddenValue)
{HiddenValue.value=point;}}});if(!this.addOverlayEvent)
{this.addOverlayEvent=GEvent.addListener(this.curMap,"addoverlay",function(overlay)
{if(This.clickEvent)
GEvent.removeListener(This.clickEvent);varIdDetach.src=This.hostURL+"images/icons/btn_map_hand_on.gif";varIdAttach.src=This.hostURL+"images/icons/btn_map_orange_off.gif";var varDivMap=document.getElementById(This.mapDivName);varDivMap.childNodes[0].style.cursor="";SetExactRadioButton();overlay.disableDragging();});}}
function _DetachPinMoveEvent()
{if(this.clickEvent)
GEvent.removeListener(this.clickEvent);this.clickEvent=null;var varIdDetach=document.getElementById('id'+this.mapName+'Default');varIdDetach.src=this.hostURL+"images/icons/btn_map_hand_on.gif";var varIdAttach=document.getElementById('id'+this.mapName+'AttachPin');varIdAttach.src=this.hostURL+"images/icons/btn_map_orange_off.gif";}
function _RenderProductLocations()
{this.currentMapBounds=new GLatLngBounds();var iCount=0;var point;var marker;var letter;var address;var defaultImage;processNextProduct(0,100,this);}
function getAddressProduct(i,delay,CWGoogleMapObject)
{var defaultImage=CWGoogleMapObject.hostURL+VICIcon;var bHasLat=CWGoogleMapObject.locationsToRenderArray[i].latlong;var bHasLng=CWGoogleMapObject.locationsToRenderArray[i].latlong;var iCount=0;var point;var marker;var letter;var address;var defaultImage;address=CWGoogleMapObject.locationsToRenderArray[i].description;curProductId=CWGoogleMapObject.locationsToRenderArray[i].locationid;iCount=CWGoogleMapObject.locationsToRenderArray[i].locationpriority-1;var bRecenter=true;if(CWGoogleMapObject.locationsToRenderArray[i].region<0)
defaultImage=CWGoogleMapObject.hostURL+VICIcon;else if((CWGoogleMapObject.locationsToRenderArray[i].locationtype=="ProductLocation")||(CWGoogleMapObject.locationsToRenderArray[i].locationtype=="CombinedProductLocation"))
defaultImage=CWGoogleMapObject.hostURL+RedIcon;else if(CWGoogleMapObject.locationsToRenderArray[i].locationtype=="GatewayAirport")
defaultImage=CWGoogleMapObject.hostURL+BlueIcon;else if(CWGoogleMapObject.locationsToRenderArray[i].locationtype=="ExperienceLocation"||CWGoogleMapObject.locationsToRenderArray[i].locationtype=="ExperienceLocationHideAddress")
defaultImage=CWGoogleMapObject.hostURL+GreenIcon;else if(CWGoogleMapObject.locationsToRenderArray[i].locationtype=="BlogEntryLocation")
defaultImage=CWGoogleMapObject.hostURL+OrangeIcon;var GoogleAddress=address.substring(0,address.indexOf("||"));if(!bHasLat&&!bHasLng)
{CWGoogleMapObject.geocoder.getLocations(GoogleAddress,function(result)
{if(result.Status.code==G_GEO_TOO_MANY_QUERIES)
{processNextProduct(i,delay+1,CWGoogleMapObject);}
else
{if(result.Status.code==G_GEO_SUCCESS)
{var p=result.Placemark[0].Point.coordinates;var lat=p[1];var lng=p[0];if(CWGoogleMapObject.locationsToRenderArray[i].locationtype=="ProductLocation")
MapBase.StoreGeocodeData(CWGoogleMapObject.locationsToRenderArray[i].locationid,lng,lat,false,SetProductGeoData_CallBack);CWGoogleMapObject.locationsToRenderArray[i].latlong=new GLatLng(lat,lng);createMarker(address,iCount,CWGoogleMapObject.baseIcon,CWGoogleMapObject.locationsToRenderArray[i],defaultImage,CWGoogleMapObject,CWGoogleMapObject.locationsToRenderArray.length,this.svClient,bRecenter);}
processNextProduct(i+1,delay,CWGoogleMapObject);}});}
else
{createMarker(address,iCount,CWGoogleMapObject.baseIcon,CWGoogleMapObject.locationsToRenderArray[i],defaultImage,CWGoogleMapObject,CWGoogleMapObject.locationsToRenderArray.length,this.svClient,bRecenter);processNextProduct(i+1,delay,CWGoogleMapObject);}}
function processNextProduct(index,delay,CWGoogleMapObject)
{if(index<CWGoogleMapObject.locationsToRenderArray.length)
{if(CWGoogleMapObject.locationsToRenderArray[index].latlong)
getAddressProduct(index,delay,CWGoogleMapObject);else
setTimeout(function(){getAddressProduct(index,delay,CWGoogleMapObject);},delay);}}
function _RenderProductSearchResultLocationsGoogle()
{var defaultCityImage=this.hostURL+YellowIcon;var defaultImage=this.hostURL+"images/google_pin_blue_small.gif";var mapbounds=new GLatLngBounds();var iCount=0;var curProductId=0;var lastProductId=0;var point;var marker;var letter;var address;var isVIC=0;for(i=0;i<this.locationsToRenderArray.length;i++)
{isVIC=0;if(this.locationsToRenderArray[i]!=null)
{if(this.locationsToRenderArray[i].showOnMap)
{address=this.locationsToRenderArray[i].description;curProductId=this.locationsToRenderArray[i].locationid;iCount=this.locationsToRenderArray[i].locationpriority-1;if(iCount<26)
letter=String.fromCharCode("A".charCodeAt(0)+iCount);else
{var module=iCount%26;letter=String.fromCharCode("A".charCodeAt(0)+module);}
if((this.locationsToRenderArray[i].locationtype=="ProductLocation")||(this.locationsToRenderArray[i].locationtype=="CombinedProductLocation"))
{if(this.locationsToRenderArray[i].region>0)
defaultImage=this.hostURL+"images/icons/purple_icon_"+letter+".gif";else if(this.locationsToRenderArray[i].region<0)
{defaultImage=this.hostURL+"images/icons/icon_vic_"+letter+".gif";isVIC=1;}
else
defaultImage=this.hostURL+"images/icons/red_icon_"+letter+".png";}
else if(this.locationsToRenderArray[i].locationtype=="CityCenter")
defaultImage=defaultCityImage;else if(this.locationsToRenderArray[i].locationtype=="ExperienceLocation"||this.locationsToRenderArray[i].locationtype=="ExperienceLocationHideAddress")
defaultImage=this.hostURL+"images/icons/green_icon_"+letter+".png";if(isVIC>0)
createMarker(address,iCount,this.VICbaseIconSearchResults,this.locationsToRenderArray[i],defaultImage,this,this.locationsToRenderArray.length,this.svClient);else
createMarker(address,iCount,this.baseIcon,this.locationsToRenderArray[i],defaultImage,this,this.locationsToRenderArray.length,this.svClient);lastProductId=curProductId;}}}}
function _HandleVICAjaxCall(response)
{VICProducts=response.value;var iCount=0;if(VICProducts!=null&&VICProducts.length>0)
{this.curMap.savePosition();this.VICsToRenderArray=new Array();processNextVIC(0,100,this);this.VICsToRenderArray.sort(sortByPriority);}}
function getAddressVIC(i,delay,CWGoogleMapObject)
{var defaultImage=CWGoogleMapObject.hostURL+VICIcon;var bHasLat=false;var bHasLng=false;if(VICProducts[i].Latitude&&VICProducts[i].Latitude>=-90&&VICProducts[i].Latitude<=90)bHasLat=true;if(VICProducts[i].Longitude&&VICProducts[i].Longitude>=-180&&VICProducts[i].Longitude<=180)bHasLng=true;if(!bHasLat&&!bHasLng)
{CWGoogleMapObject.geocoder.getLocations(VICProducts[i].GoogleAddress,function(result)
{if(result.Status.code==G_GEO_TOO_MANY_QUERIES)
{processNextVIC(i,delay+1,CWGoogleMapObject);}
else
{if(result.Status.code==G_GEO_SUCCESS)
{var p=result.Placemark[0].Point.coordinates;var lat=p[1];var lng=p[0];MapBase.StoreGeocodeData(VICProducts[i].ProductID,lng,lat,false,SetProductGeoData_CallBack);var loc=new Location(VICProducts[i].LocationType,new GLatLng(lat,lng),VICProducts[i].ProductName,VICProducts[i].ProductAddress,VICProducts[i].ProductURL,VICProducts[i].ProductImageURL,VICProducts[i].ProductID,VICProducts[i].LocationPriority,true,0);CWGoogleMapObject.VICsToRenderArray.push(loc);createMarker(VICProducts[i].GoogleAddress+'||'+VICProducts[i].ProductDescription,i,CWGoogleMapObject.VICbaseIcon,loc,defaultImage,CWGoogleMapObject,VICProducts.length,this.svClient,false,false);}
processNextVIC(i+1,delay,CWGoogleMapObject);}});}
else
{var loc=new Location(VICProducts[i].LocationType,new GLatLng(VICProducts[i].Latitude,VICProducts[i].Longitude),VICProducts[i].ProductName,VICProducts[i].ProductAddress,VICProducts[i].ProductURL,VICProducts[i].ProductImageURL,VICProducts[i].ProductID,VICProducts[i].LocationPriority,true,0);CWGoogleMapObject.VICsToRenderArray.push(loc);createMarker(VICProducts[i].GoogleAddress+'||'+VICProducts[i].ProductDescription,i,CWGoogleMapObject.VICbaseIcon,loc,defaultImage,CWGoogleMapObject,VICProducts.length,this.svClient,false,false);processNextVIC(i+1,delay,CWGoogleMapObject);}}
function processNextVIC(index,delay,CWGoogleMapObject)
{if(index<VICProducts.length)
{setTimeout(function(){getAddressVIC(index,delay,CWGoogleMapObject);},delay);}}
function _RenderVICMarkers(bShow)
{var NumPinsToPlaceOnMap=defaultNumLocToShowInView;var bounds=ComputeMapBoundsWithOffset(this.curMap);if(bShow!=undefined)this.bShowVICs=bShow;if(this.bShowVICs)
{var tempArray=new Array();tempArray=this.VICsOnMap;this.VICsOnMap=new Array();if(this.VICsToRenderArray!=null&&this.VICsToRenderArray.length>0)
{for(i=0;i<this.VICsToRenderArray.length;i++)
{if(this.VICsToRenderArray[i]!=null&&this.VICsToRenderArray[i].shape!=null&&this.VICsOnMap.length<NumPinsToPlaceOnMap&&bounds.containsLatLng(this.VICsToRenderArray[i].shape.getLatLng()))
{var index=-1;for(j=0;j<tempArray.length;j++)if(this.VICsToRenderArray[i].shape==tempArray[j]){index=j;break;}
var productIndex=-1;for(j=0;j<this.locationsToRenderArray.length;j++)if(this.locationsToRenderArray[j]!=null&&this.VICsToRenderArray[i].locationid==this.locationsToRenderArray[j].locationid){productIndex=j;break;}
if(index==-1&&productIndex==-1)
{this.curMap.addOverlay(this.VICsToRenderArray[i].shape);this.VICsOnMap.push(this.VICsToRenderArray[i].shape);}
else if(index>-1)
{this.VICsOnMap.push(tempArray[index].shape);tempArray.splice(index,1);}}}}
for(i=0;i<tempArray.length;i++)
{if(tempArray[i]!=null)
this.curMap.removeOverlay(tempArray[i]);}}
else
{for(i=0;i<this.VICsToRenderArray.length;i++)
{if(this.VICsToRenderArray[i]!=null&&this.VICsToRenderArray[i].shape!=null)
this.curMap.removeOverlay(this.VICsToRenderArray[i].shape);}
this.VICsOnMap=new Array();}}
function _SelectTopNLocationsInView(n,regionid)
{var NumPinsToPlaceOnMap=defaultNumLocToShowInView;var BoundingAreaId=BCRegionID;var NumOfPinsInView=0;var bounds=ComputeMapBoundsWithOffset(this.curMap);var locationIcon=new GIcon(this.baseIcon);locationIcon.image=this.hostURL+YellowIcon;if(regionid!=null)
BoundingAreaId=regionid;if(n!=null&&n>0)
NumPinsToPlaceOnMap=n;if(this.selectedCity&&this.selectedCity>-1)
{NumOfPinsInView+=1;}
if(DetailLocationId>-1)
{NumOfPinsInView+=1;}
for(j=0;j<this.locationsArray.length;j+=1)
{if(j!=this.selectedCity&&this.locationsArray[j].locationid!=DetailLocationId)
{if(bounds.contains(this.locationsArray[j].latlong))
{if(regionid==3)
{if(NumOfPinsInView<NumPinsToPlaceOnMap)
{var curLocation=this.locationsArray[j];if(!curLocation.shape)
{curLocation.shape=new GMarker(curLocation.latlong,locationIcon);this.curMap.addOverlay(curLocation.shape);}
AttachPinClickEvent(curLocation);NumOfPinsInView+=1;}
else
{if(this.locationsArray[j].shape)
{this.curMap.removeOverlay(this.locationsArray[j].shape);this.locationsArray[j].shape=null;}}}
else
{var curLocation=this.locationsArray[j];if(!curLocation.shape)
{curLocation.shape=new GMarker(curLocation.latlong,locationIcon);this.curMap.addOverlay(curLocation.shape);}
AttachPinClickEvent(curLocation);}}
else
{if(this.locationsArray[j].shape)
{this.curMap.removeOverlay(this.locationsArray[j].shape);this.locationsArray[j].shape=null;}}}}}
function sortByPriority(a,b)
{if(a.locationpriority&&b.locationpriority)
return a.locationpriority-b.locationpriority;else
return-1;}
function _GetLocationsArrayIndexByLocationId(locationId)
{var locationIndex=-1;for(i=0;i<this.locationsArray.length;i+=1)
{if(this.locationsArray[i].locationid==locationId)
{locationIndex=i;break;}}
return locationIndex;}
function _AddShapeLayer(source)
{var geoRss=new GGeoXml(source);this.curMap.addOverlay(geoRss);}
function _HighlightRegionFromEncoded(regionid,centerandzoom,usemapdefaults)
{var source="";var shape=null;var icon=new GIcon(this.baseIcon);var bRegionSelected=false;for(i=0;i<RegionInfoArray.length;i+=1)
{if(i!=BCRegionID)
{if(RegionInfoArray[i])
{if(i==regionid&&RegionInfoArray[i].showRegion){bRegionSelected=true;break;}
else{RegionInfoArray[i].showRegion=false;if(RegionInfoArray[i].shape)
{this.curMap.removeOverlay(RegionInfoArray[i].shape);}
if(RegionInfoArray[i].marker){this.curMap.removeOverlay(RegionInfoArray[i].marker);}}}}}
if(!bRegionSelected){if(RegionInfoArray[regionid].shape)
{RegionInfoArray[regionid].showRegion=true;}
else
{var mypolygon=new GPolygon.fromEncoded({polylines:[{points:RegionInfoArray[regionid].encodedString,levels:RegionInfoArray[regionid].levels,color:RegionInfoArray[regionid].colour,opacity:0.7,weight:1,numLevels:RegionInfoArray[regionid].numlevels,zoomFactor:RegionInfoArray[regionid].zoomFactor}],fill:true,color:RegionInfoArray[regionid].colour,opacity:RegionInfoArray[regionid].opacity,outline:false});RegionInfoArray[regionid].shape=mypolygon;RegionInfoArray[regionid].showRegion=true;}
DrawRegions(this.curMap);if(RegionInfoArray[regionid].description)
{if(!RegionInfoArray[regionid].marker)
{icon.image=this.hostURL+InvisibleIcon;icon.shadow=this.hostURL+InvisibleIcon;icon.iconsize=new GSize(1,1);icon.iconAnchor=new GPoint(1,1);var marker=new GMarker(RegionInfoArray[regionid].centrePoint,icon);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(RegionInfoArray[regionid].description);});RegionInfoArray[regionid].marker=marker;}
this.curMap.addOverlay(RegionInfoArray[regionid].marker);RegionInfoArray[regionid].marker.openInfoWindowHtml(RegionInfoArray[regionid].description);}}
else{if(this.curMap.getInfoWindow().isHidden())
RegionInfoArray[regionid].marker.openInfoWindowHtml(RegionInfoArray[regionid].description);}
if(centerandzoom)
{if(usemapdefaults){if(this.curMap.getCenter()!=defaultCentre||this.curMap.getZoom()!=defaultZoomLevel)
this.curMap.setCenter(defaultCentre,defaultZoomLevel);}
else{if(this.curMap.getCenter()!=RegionInfoArray[regionid].centrePoint||this.curMap.getZoom()!=RegionInfoArray[regionid].defaultZoomLevel)
this.curMap.setCenter(RegionInfoArray[regionid].centrePoint,RegionInfoArray[regionid].defaultZoomLevel);}}}
function _OutlineProvinceFromEncoded()
{var source="";var shape=null;if(RegionInfoArray[BCRegionID].shape)
{RegionInfoArray[BCRegionID].showRegion=true;}
else
{var mypolyline=new GPolyline.fromEncoded({color:RegionInfoArray[BCRegionID].colour,weight:1,opacity:1,points:RegionInfoArray[BCRegionID].encodedString,levels:RegionInfoArray[BCRegionID].levels,zoomFactor:2,numLevels:18});RegionInfoArray[BCRegionID].shape=mypolyline;RegionInfoArray[BCRegionID].showRegion=true;}}
function _AttachRecalculateViewEvents(methodName)
{GEvent.addListener(this.curMap,"moveend",methodName);GEvent.addListener(this.curMap,"zoomend",methodName);}
function DrawRegions(mapObject)
{for(i=0;i<RegionInfoArray.length;i+=1)
{if(RegionInfoArray[i])
{if(RegionInfoArray[i].showRegion==true)
{mapObject.addOverlay(RegionInfoArray[i].shape);}}}}
function HighlightRegion(mapObject,regionid,centerandzoom,usemapdefaults)
{mapObject.HighlightRegion(regionid,centreandzoom,usemapdefaults);}
function HideRegion(mapObject,regionid)
{if(RegionInfoArray[regionid])
{RegionInfoArray[regionid].showRegion=false;mapObject.removeOverlay(RegionInfoArray[regionid].shape);}}
function FrameSelectedLocation(cwMapObject,dropdownName)
{var dropDown=document.getElementById(dropdownName);var selectedItemIndex=-1;var latlongobject=null;var splitValues=new Array();var selectedItemValue="";var selectedItemLat="";var selectedItemLong="";var selectedItemLocationId=-1;var bounds=cwMapObject.curMap.getBounds();var icon=new GIcon(cwMapObject.baseIcon);if(dropDown!=null)
{selectedItemIndex=dropDown.selectedIndex;if(selectedItemIndex>-1)
{selectedItemValue=dropDown.options[selectedItemIndex].value;if(selectedItemValue!=null)
{selectedItemLocationId=selectedItemValue.substring(0,selectedItemValue.indexOf("|"));cwMapObject.selectedCity=cwMapObject.GetLocationsArrayIndexByLocationId(selectedItemLocationId);if(selectedItemLocationId>-1)
{if(RegionInfoArray[selectedItemLocationId])
{cwMapObject.HighlightRegionFromEncoded(selectedItemLocationId,true,true);if(SlideRegion)SlideRegion(RegionInfoArray[selectedItemLocationId].tag);}
else
{splitValues=selectedItemValue.split("|");selectedItemLat=splitValues[1];selectedItemLong=splitValues[2];var highlightedLocation=cwMapObject.locationsArray[cwMapObject.selectedCity];for(var i in RegionInfoArray)
{if(RegionInfoArray[i].description){if(RegionInfoArray[i].marker){cwMapObject.curMap.removeOverlay(RegionInfoArray[i].marker);}
if(RegionInfoArray[i].shape){cwMapObject.curMap.removeOverlay(RegionInfoArray[i].shape);}
RegionInfoArray[i].showRegion=false;}}
if(highlightedLocation)
{var viewPanoramaLinkHTML="";var locationPoint=new GLatLng(selectedItemLat,selectedItemLong);var svClient=new GStreetviewClient();try{svClient.getNearestPanorama(locationPoint,function(svLatLong){if(svLatLong.code==200){viewPanoramaLinkHTML="<p style=\"margin-top:5px;\"><img style=\"margin:0px;\" src=\"/TBCCW/images/icons/icon_streetview_sm.gif\" /><a href='javascript: ShowPano(new GLatLng"+locationPoint+");'>Show Street View</a></p>";}});}catch(error){}
if(!highlightedLocation.shape)
{icon.image=cwMapObject.hostURL+YellowIcon;highlightedLocation.shape=new GMarker(highlightedLocation.latlong,icon);cwMapObject.curMap.addOverlay(highlightedLocation.shape);}
if((highlightedLocation.image!=null)&&(highlightedLocation.image!=''))
highlightedLocation.shape.openInfoWindowHtml("<table class='gmOverlay'><caption>"+highlightedLocation.name+"</caption><tr><td><img src='"+highlightedLocation.image+"' /></td><td><p>"+highlightedLocation.description+"</p></td></tr></table>"+viewPanoramaLinkHTML);else
highlightedLocation.shape.openInfoWindowHtml("<table class='gmOverlay'><caption>"+highlightedLocation.name+"</caption><tr><td></td><td>"+highlightedLocation.description+"</td></tr></table>"+viewPanoramaLinkHTML);}
else
{icon.image=cwMapObject.hostURL+OrangeIcon;var locationMarker=new GMarker(new GLatLng(selectedItemLat,selectedItemLong),{draggable:true,icon:icon});var varIdDetach=document.getElementById('id'+cwMapObject.mapName+'Default');var varIdAttach=document.getElementById('id'+cwMapObject.mapName+'AttachPin');var HiddenValue=document.getElementById('ctrl'+cwMapObject.mapName+'_hiddenGeoData');GEvent.addListener(locationMarker,"dragend",function()
{if(cwMapObject.clickEvent)
GEvent.removeListener(cwMapObject.clickEvent);varIdDetach.src=cwMapObject.hostURL+"images/icons/btn_map_hand_on.gif";varIdAttach.src=cwMapObject.hostURL+"images/icons/btn_map_orange_off.gif";var varDivMap=document.getElementById(cwMapObject.mapDivName);varDivMap.childNodes[0].style.cursor="";SetExactRadioButton();this.disableDragging();cwMapObject.inEditMode=false;if(HiddenValue)
{HiddenValue.value=this.getPoint();}});GEvent.addListener(locationMarker,"mousedown",function()
{if(cwMapObject.inEditMode)
this.enableDragging();});locationMarker.disableDragging();cwMapObject.curMap.clearOverlays();cwMapObject.curMap.addOverlay(locationMarker);if(HiddenValue)
{HiddenValue.value=locationMarker.getPoint();}
SetApproximateRadioButton();}
cwMapObject.curMap.setCenter(new GLatLng(selectedItemLat,selectedItemLong),7);}}
else
{cwMapObject.curMap.setCenter(defaultCentre,defaultZoomLevel);}}}}}
function createMarker(address,index,baseIcon,Location,imageURL,CWGoogleObject,numLocationsToRender,svClient,bRecentre,bPlaceMarker)
{mapbounds=CWGoogleObject.currentMapBounds;GoogleMap=CWGoogleObject.curMap;var LocPopUpDescription="";if(Location.locationtype!="ExperienceLocationHideAddress")
LocPopUpDescription=Location.description;var icon=new GIcon(baseIcon);icon.image=imageURL;var locationPoint;var combinedPopUpHTML;var fallBackPopUpHTML;var locationName='&nbsp;';var locationURL='&nbsp;';if(Location.name!=null){locationName=Location.name;if(Location.url!=null){locationURL="<a href='"+Location.url+"'>&gt;&nbsp;View Details</a>";}}
if(Location.latlong)
{locationPoint=Location.latlong;combinedPopUpHTML=Location.description.substring(Location.description.indexOf("||")+1);fallBackPopUpHTML="<table class='gmOverlay'><caption>"+locationName+"</caption><tr><td>"+((Location.image!=null)?"<img src='"+Location.image+"' />":"")+"</td><td>"+(Location.description!=null?Location.description+"<br/>":"")+"</td></tr></table>";}
else
{combinedPopUpHTML=address.substring(address.indexOf("||")+1);var GoogleAddress=address.substring(0,address.indexOf("||"));var PopUpAddress=address.substring(address.indexOf("||")+1);fallBackPopUpHTML="<table class='gmOverlay'><caption>"+locationName+"</caption><tr><td>"+((Location.image!=null)?"<img src='"+Location.image+"' />":"")+"</td><td>"+(PopUpAddress!=null?PopUpAddress+"<br/>":"")+"</td></tr></table>";this.geocoder.getLatLng(GoogleAddress,function(point)
{if(!point)
{var iconID;iconID=AssignIconicId(Location);iconID=iconID+Location.locationid;var imgArray=document.images;if(imgArray!=null){for(i=0;i<imgArray.length;i++){if(imgArray[i].id==iconID)
imgArray[i].style.display='none';}}}
else
{if(point)
PlaceMarkerOnMap(Location,point,icon,bPlaceMarker,bRecentre,numLocationsToRender,svClient,fallBackPopUpHTML,combinedPopUpHTML,LocPopUpDescription);if(Location.locationtype=="ProductLocation")
MapBase.StoreGeocodeData(Location.locationid,point.lng(),point.lat(),false,SetProductGeoData_CallBack);}});}
if(locationPoint)
PlaceMarkerOnMap(Location,locationPoint,icon,bPlaceMarker,bRecentre,numLocationsToRender,svClient,fallBackPopUpHTML,combinedPopUpHTML,LocPopUpDescription);}
function PlaceMarkerOnMap(Location,locationPoint,icon,bPlaceMarker,bRecentre,numLocationsToRender,svClient,fallBackPopUpHTML,combinedPopUpHTML,LocPopUpDescription)
{if(locationPoint!=null)
{var marker=new GMarker(locationPoint,icon);var locationName='&nbsp;';var locationURL='&nbsp;';if(Location.name!=null){locationName=Location.name;if(Location.url!=null){locationURL="<a href='"+Location.url+"'>&gt;&nbsp;View Details</a>";}}
if(bPlaceMarker==undefined||bPlaceMarker)GoogleMap.addOverlay(marker);if(bRecentre==undefined||bRecentre)
{if(numLocationsToRender>1)
{mapbounds.extend(marker.getPoint());GoogleMap.setZoom(GoogleMap.getBoundsZoomLevel(mapbounds)-1);GoogleMap.setCenter(mapbounds.getCenter());}
else
{GoogleMap.setZoom(defaultSingleLocationZoomLevel);GoogleMap.setCenter(marker.getPoint());}}
var viewPanoramaLinkHTML=null;if(svClient==null)
svClient=new GStreetviewClient();try{svClient.getNearestPanorama(locationPoint,function(svLatLong){if(svLatLong.code==200){viewPanoramaLinkHTML="<p style=\"margin-top:5px;\"><img style=\"margin:0px;\" src=\"/TBCCWJP/images/icons/icon_streetview_sm.gif\" /><a href='javascript: ShowPano(new GLatLng"+locationPoint+");'>Show Street View</a></p>";}});}catch(error){}
GEvent.addListener(marker,"click",function()
{if(Location.locationtype=="ProductLocation"||Location.locationtype=="ExperienceLocation"||Location.locationtype=="ExperienceLocationHideAddress")
{if((Location.image!=null)&&(Location.image!=''))
marker.openInfoWindowHtml(GeneratePopUpHTML(true,locationName,Location.image,LocPopUpDescription,locationURL,viewPanoramaLinkHTML));else
marker.openInfoWindowHtml(GeneratePopUpHTML(false,locationName,Location.image,LocPopUpDescription,locationURL,viewPanoramaLinkHTML));}
else if(Location.locationtype=="CombinedProductLocation")
marker.openInfoWindowHtml(combinedPopUpHTML+(viewPanoramaLinkHTML!=null?"<br/>"+viewPanoramaLinkHTML:""));else
marker.openInfoWindowHtml(fallBackPopUpHTML+(viewPanoramaLinkHTML!=null?"<br/>"+viewPanoramaLinkHTML:""));});Location.shape=marker;}}
function AttachPinClickEvent(curLocation)
{var viewPanoramaLinkHTML="";var svClient=new GStreetviewClient();try{svClient.getNearestPanorama(curLocation.latlong,function(svLatLong){if(svLatLong.code==200){viewPanoramaLinkHTML="<p style=\"margin-top:5px;\"><img style=\"margin:0px;\" src=\"/TBCCW/images/icons/icon_streetview_sm.gif\" /><a href='javascript: ShowPano(new GLatLng"+curLocation.latlong+");'>Show Street View</a></p>";}});}catch(error){}
GEvent.addListener(curLocation.shape,"click",function()
{DetailLocationId=curLocation.locationid;curLocation.shape.openInfoWindowHtml("<table class='gmOverlay'><caption>"+curLocation.name+"</caption><tr><td>"+((curLocation.image!=null)?"<img src='"+curLocation.image+"' />":"")+"</td><td>"+(curLocation.description!=null?curLocation.description+"<br/>":"")+"</td></tr></table>"+viewPanoramaLinkHTML);});}
function ShowHideLocationType(cwMapObject,locationType,checkBoxId)
{var curCheckBox=null;var showLocationMarker=false;if(document.getElementById)
curCheckBox=document.getElementById(checkBoxId);else if(document.all)
curCheckBox=document.all[checkBoxId];else if(document.layers)
curCheckBox=document.layers[checkBoxId];if(curCheckBox!=null)
showLocationMarker=curCheckBox.checked;for(i=0;i<cwMapObject.locationsArray.length;i+=1)
{try{if(cwMapObject.locationsArray[i]&&cwMapObject.locationsArray[i].locationtype==locationType)
{if(cwMapObject.locationsArray[i].showOnMap&&showLocationMarker)
{cwMapObject.curMap.addOverlay(cwMapObject.locationsArray[i].shape);}
else
{cwMapObject.curMap.removeOverlay(cwMapObject.locationsArray[i].shape);}}}catch(err){}}}
function ShowInlineMapLink()
{var MapLink=document.getElementById('divMapInlineLink');if(MapLink!=null)
MapLink.style.display="inline";}
function _PlaceMarkerOnMap()
{}
function Location(locationtype,latlong,name,description,url,image,locationid,locationpriority,showOnMap,region)
{if(locationtype){this.locationtype=locationtype;}
if(latlong){this.latlong=latlong;}
if(name){this.name=name;}
if(description){this.description=description;}
else
this.description="";if(url){this.url=url;}
if(image){this.image=image;}
if(locationid){this.locationid=locationid;}
if(locationpriority)
this.locationpriority=locationpriority;else
this.locationpriority=100;this.marker=null;this.showOnMap=showOnMap;if(region){this.region=region;}}
function AddLocationToArray(thisArray,index,locationtype,latlong,name,description,url,image,locationid,locationpriority,showOnMap,region){thisArray[index]=new Location(locationtype,latlong,name,description,url,image,locationid,locationpriority,showOnMap,region);}
function RegionInfo(shapetype,regionid,regionname,centrepointlat,centrepointlong,geoRssUrl,defaultZoomLevel,encodedString,levels,numlevels,colour,opacity)
{this.shapetype=shapetype;if(regionid){this.regionid=regionid;}
if(regionname){this.regionname=regionname;}
this.centrePoint=new GLatLng(centrepointlat,centrepointlong);this.geoRssUrl=geoRssUrl;this.shape=null;this.showRegion=false;this.defaultZoomLevel=defaultZoomLevel;this.encodedString=encodedString;this.levels=levels;this.numlevels=numlevels;this.colour=colour;this.zoomFactor=2;this.opacity=opacity;this.description='';this.marker=null;this.tag='';}
function toggleMapDisplay(StringShow,StringHide,MapContainer,IsMapLoaded,MapDivName)
{var objMap=document.getElementById(MapContainer);var objToggleAnchor=document.getElementById('anchor_toggleMap');if(objMap.style.display=="block"){objMap.style.display="none";objToggleAnchor.innerHTML=StringShow;}else{objMap.style.display="block";objToggleAnchor.innerHTML=StringHide;if(!IsMapLoaded)
GetMap(MapDivName);}}
function AssignIconicId(LocationObject)
{var IconicID="";if(LocationObject.locationtype=='ProductLocation'||LocationObject.locationtype=='CombinedProductLocation')
IconicID='Loc';else if(LocationObject.locationtype=='ExperienceLocation'||LocationObject.locationtype=='ExperienceLocationHideAddress')
IconicID='ExpLoc';return IconicID;}
function GeneratePopUpHTML(ContainImage,PopUpTitle,PopUpImageURL,PopUpBody,PopUpURL,viewPanoramaLinkHTML)
{var PopUpHTML="";if(ContainImage)
PopUpHTML="<table class='gmOverlay'><caption>"+PopUpTitle+"</caption><tr><td><img src='"+PopUpImageURL+"' /></td><td><p>"+PopUpBody+"</p><p>"+PopUpURL+"</p>"+(viewPanoramaLinkHTML!=null?viewPanoramaLinkHTML:"")+"</td></tr></table>";else
PopUpHTML="<table class='gmOverlay'><caption>"+PopUpTitle+"</caption><tr><td></td><td><p><p>"+PopUpBody+"</p><p>"+PopUpURL+"</p>"+(viewPanoramaLinkHTML!=null?viewPanoramaLinkHTML:"")+"</td></tr></table>";return PopUpHTML;}
function SetProductGeoData_CallBack(response)
{}
function ComputeMapBoundsWithOffset(mapObject)
{var MapBounds=mapObject.getBounds();var pixelOffset=10;var swPointOriginal=mapObject.fromLatLngToDivPixel(MapBounds.getSouthWest());var nePointOriginal=mapObject.fromLatLngToDivPixel(MapBounds.getNorthEast());var swPointNew=new GPoint(swPointOriginal.x+pixelOffset,swPointOriginal.y-pixelOffset);var nePointNew=new GPoint(nePointOriginal.x-pixelOffset,nePointOriginal.y+pixelOffset);var swLatLng=mapObject.fromDivPixelToLatLng(swPointNew);var neLatLng=mapObject.fromDivPixelToLatLng(nePointNew);var bounds=new GLatLngBounds(swLatLng,neLatLng);return bounds;}//TBCIIS7PB
//20/11/2009 1:01:02 PM

var slideInUse=new Array();var slideSpeed=1600;function Slide(objId,options){this.obj=document.getElementById(objId);this.duration=1;this.height=parseInt(this.obj.style.height);if(typeof options!='undefined'){this.options=options;}else{this.options={};}
if(this.options.duration){this.duration=this.options.duration;}
this.up=function(){this.curHeight=this.height;this.newHeight='1';if(slideInUse[objId]!=true){var finishTime=this.slide();window.setTimeout("Slide('"+objId+"').finishup("+this.height+");",finishTime);}}
this.down=function(){this.newHeight=this.height;this.curHeight='1';if(slideInUse[objId]!=true){this.obj.style.height='1px';this.obj.style.display='block';this.slide();}}
this.slide=function()
{slideInUse[objId]=true;var frames=30*duration;var tIncrement=(duration*slideSpeed)/frames;tIncrement=Math.round(tIncrement);var sIncrement=(this.curHeight-this.newHeight)/frames;var frameSizes=new Array();for(var i=0;i<frames;i++){if(i<frames/2){frameSizes[i]=(sIncrement*(i/frames))*4;}else{frameSizes[i]=(sIncrement*(1-(i/frames)))*4;}}
for(var i=0;i<frames;i++){this.curHeight=this.curHeight-frameSizes[i];window.setTimeout("document.getElementById('"+objId+"').style.height='"+Math.round(this.curHeight)+"px';",tIncrement*i);}
window.setTimeout("delete(slideInUse['"+objId+"']);",tIncrement*i);if(this.options.onComplete){window.setTimeout(this.options.onComplete,tIncrement*(i-2));}
return tIncrement*i;}
this.finishup=function(height){this.obj.style.display='none';this.obj.style.height=height+'px';}
return this;}
function IsSlideOpen(SlideName)
{var varSlideOpen=document.getElementById("currSlideopen");if(varSlideOpen.value==SlideName)
return true;else
return false;}
function SetCurrentOpenSlide(SlideName)
{var varSlideOpen=document.getElementById("currSlideopen");varSlideOpen.value=SlideName;}
function SetCurrentHeader(HeaderName)
{if(RegionDivIdsArray!=null&&RegionDivIdsArray.length>0)
{for(i=0;i<RegionDivIdsArray.length;i++)
{var varHeader=RegionDivIdsArray[i]+"Header";document.getElementById(varHeader).className="";}}
document.getElementById(HeaderName).className="on";}
function SlideRegion(RegionDivID)
{if(!IsSlideOpen(RegionDivID))
{Slide(RegionDivID).down();if(RegionDivIdsArray!=null&&RegionDivIdsArray.length>0)
{for(i=0;i<RegionDivIdsArray.length;i++)
{if(RegionDivIdsArray[i]!=RegionDivID)
Slide(RegionDivIdsArray[i]).up();}}
SetCurrentOpenSlide(RegionDivID);SetCurrentHeader(RegionDivID+'Header');}}//TBCIIS7PB
//20/11/2009 1:01:02 PM

var nav=!(window.attachEvent&&!window.opera);if(nav)
{addKeyEvent();window.onkeydown=NetscapeEventHandler_CheckKey;}
else
{document.onkeydown=checkKey;}
function addEvent(obj,evType,fn,useCapture)
{if(obj.addEventListener)
{obj.addEventListener(evType,fn,useCapture);return true;}
else if(obj.attachEvent)
{var r=obj.attachEvent("on"+evType,fn);return r;}
else
{}}
function addKeyEvent()
{var ev=(document.addEventListener)?'keypress':'keydown';addEvent(document,ev,NetscapeEventHandler_CheckKey,false);}
function MicrosoftEventHandler_KeyDown()
{alert(event.srcElement.type);if(event.keyCode==13&&event.srcElement.type!='textarea'&&event.srcElement.type!='submit')
return false;return true;}
function NetscapeEventHandler_CheckKey(e)
{if(e.which==13)
{var buttonHeaderGo=eval(document.getElementById("ctrlGlobalSearch_btnGo"));var buttonReviseSearchGo=eval(document.getElementById("ctrlGlobalSearch_btnGo"));var buttonSearchGo=eval(document.getElementById("ctrlGlobalSearch_btnGo"));var buttonSearchGo1=eval(document.getElementById("btnGo1"));var buttonSearchGo2=eval(document.getElementById("btnGo2"));var buttonNonAccommSearch=eval(document.getElementById("cntlSearchNonAccomm_btnSubmit"));var buttonUGMLogin=eval(document.getElementById("btnLogin"));var txtHeader=eval(document.getElementById("ctrlGlobalSearch_globalSiteSearchTextInput"));var txtReviseSearch=eval(document.getElementById("uctlReviseSearch_accommodationNameHotelCode"));var txtSearch=eval(document.getElementById("accommodationNameHotelCode"));var txtSearch1=eval(document.getElementById("searchResultsSearchTextInput"));var txtSearch2=eval(document.getElementById("searchResultsSearchTextInput2"));var txtNonAccommKey=eval(document.getElementById("cntlSearchNonAccomm_nonAccommKeywords"));var txtUGMUserName=eval(document.getElementById("txtUsername"));var txtUGMPassword=eval(document.getElementById("txtPassword"));if((txtUGMPassword!=null)&&(txtUGMPassword.value!='')&&(txtUGMPassword==e.target))
{buttonUGMLogin.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((buttonReviseSearchGo!=null)&&(buttonReviseSearchGo==e.target))
{buttonReviseSearchGo.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((buttonSearchGo!=null)&&(buttonSearchGo==e.target))
{buttonSearchGo.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((buttonSearchGo1!=null)&&(buttonSearchGo1==e.target))
{buttonSearchGo1.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((buttonSearchGo2!=null)&&(buttonSearchGo2==e.target))
{buttonSearchGo2.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if(buttonHeaderGo==e.target)
{buttonHeaderGo.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((txtHeader!=null)&&(txtHeader==e.target))
{buttonHeaderGo.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((txtReviseSearch!=null)&&(txtReviseSearch==e.target))
{buttonReviseSearchGo.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((txtSearch!=null)&&(txtSearch==e.target))
{buttonSearchGo.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((txtSearch1!=null)&&(txtSearch1==e.target))
{buttonSearchGo1.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((txtSearch2!=null)&&(txtSearch2==e.target))
{buttonSearchGo2.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if((txtNonAccommKey!=null)&&(txtNonAccommKey==e.target))
{buttonNonAccommSearch.click();e.cancelBubble=true;e.returnValue=false;return false;}
else if(e.target.type!='textarea'&&e.target.type!='select-one')
{e.cancelBubble=true;e.returnValue=false;return false;}}}
function checkKey()
{if(window.event.keyCode==13)
{var buttonHeaderGo=eval(document.getElementById("ctrlGlobalSearch_btnGo"));var buttonReviseSearchGo=eval(document.getElementById("ctrlGlobalSearch_btnGo"));var buttonSearchGo=eval(document.getElementById("ctrlGlobalSearch_btnGo"));var buttonSearchGo1=eval(document.getElementById("btnGo1"));var buttonSearchGo2=eval(document.getElementById("btnGo2"));var buttonNonAccommSearch=eval(document.getElementById("cntlSearchNonAccomm_btnSubmit"));var buttonUGMLogin=eval(document.getElementById("btnLogin"));var txtHeader=eval(document.getElementById("ctrlGlobalSearch_globalSiteSearchTextInput"));var txtReviseSearch=eval(document.getElementById("uctlReviseSearch_accommodationNameHotelCode"));var txtSearch=eval(document.getElementById("accommodationNameHotelCode"));var txtSearch1=eval(document.getElementById("searchResultsSearchTextInput"));var txtSearch2=eval(document.getElementById("searchResultsSearchTextInput2"));var txtNonAccommKey=eval(document.getElementById("cntlSearchNonAccomm_nonAccommKeywords"));var txtUGMUserName=eval(document.getElementById("txtUsername"));var txtUGMPassword=eval(document.getElementById("txtPassword"));if((txtUGMPassword!=null)&&(txtUGMPassword.value!='')&&(txtUGMPassword==event.srcElement))
{buttonUGMLogin.click();event.returnValue=false;}
else if((buttonReviseSearchGo!=null)&&(buttonReviseSearchGo==event.srcElement))
{buttonReviseSearchGo.click();event.returnValue=false;}
else if((buttonSearchGo!=null)&&(buttonSearchGo==event.srcElement))
{buttonSearchGo.click();event.returnValue=false;}
else if((buttonSearchGo1!=null)&&(buttonSearchGo1==event.srcElement))
{buttonSearchGo1.click();event.returnValue=false;}
else if((buttonSearchGo2!=null)&&(buttonSearchGo2==event.srcElement))
{buttonSearchGo2.click();event.returnValue=false;}
else if(buttonHeaderGo==event.srcElement)
{buttonHeaderGo.click();event.returnValue=false;}
else if((txtHeader!=null)&&(txtHeader==event.srcElement))
{buttonHeaderGo.click();event.returnValue=false;}
else if((txtReviseSearch!=null)&&(txtReviseSearch==event.srcElement))
{buttonReviseSearchGo.click();event.returnValue=false;}
else if((txtSearch!=null)&&(txtSearch==event.srcElement))
{buttonSearchGo.click();event.returnValue=false;}
else if((txtSearch1!=null)&&(txtSearch1==event.srcElement))
{buttonSearchGo1.click();event.returnValue=false;}
else if((txtSearch2!=null)&&(txtSearch2==event.srcElement))
{buttonSearchGo2.click();event.returnValue=false;}
else if((txtNonAccommKey!=null)&&(txtNonAccommKey==event.srcElement))
{buttonNonAccommSearch.click();event.returnValue=false;}
else if(event.srcElement.type!='textarea'&&event.srcElement.type!='select-one')
{window.event.cancelBubble=true;window.event.returnValue=false;}}}